<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript" src="./dist/zh_address.js"></script>
    <!-- <script type="text/javascript" src="./dist/zh_address_all.js"></script> -->
</head>
<body>
    <button onclick="change(true)">繁体</button><button onclick="change(false)">简体</button><hr>
    <button onclick="getProvince()">获取省级数据</button><hr>
    <input type="text" id="input1" placeholder="地区代码"><button onclick="getChild()">获取下级数据</button><hr>
    <input type="text" id="input2" placeholder="地区代码"><button onclick="getProvinceName()">获取省名称</button><hr>
    <input type="text" id="input3" placeholder="地区代码"><button onclick="getChildName()">获取子级名称</button><hr>
    结果看控制台
    <script type="text/javascript">
        var traditional = false;
        //繁体简体选择
        function change(tag){
            traditional = tag ? true : false;    
        }
        //获取子级数组
        function getChild() {
            var input1 = document.getElementById("input1").value;
            console.log(zh_address.getChildArrayByPid(input1,traditional));
        }
        //获取省级数组
        function getProvince(){
            console.log(zh_address.getProvinceArray(traditional));
        }
        //获取省级名称
        function getProvinceName(){
            var input2 = document.getElementById("input2").value;
            console.log(zh_address.getProvinceName(input2,traditional));
        }
        //获取子级名称
        function getChildName(){
            var input3 = document.getElementById("input3").value;
            console.log(zh_address.getChildName(input3,traditional));
        }
    </script>
</body>
</html>